<?xml version="1.0" encoding="utf-8"?>
<Content type="xform" name="EditContent">
  <model>
    <instance>
      <tblContent>
        <nContentKey/>
        <nContentPrimaryId/>
        <nVersion/>
        <cContentForiegnRef/>
        <cContentName/>
        <cContentSchemaName>Module</cContentSchemaName>
        <cContentXmlBrief>
          <Content moduleType="EventList" contentType="Event" box="" title="" link="" linkType="internal" linkText="More events" sortBy="StartDate" order="ascending" cols="1" stepBy="" stepCount="0" display="all" rss="false" position="" listGroup="true" autoplay="true" autoPlaySpeed="2000"/>
        </cContentXmlBrief>
        <cContentXmlDetail/>
        <nAuditId/>
        <nAuditKey/>
        <dPublishDate/>
        <dExpireDate/>
        <dInsertDate/>
        <nInsertDirId/>
        <dUpdateDate/>
        <nUpdateDirId/>
        <nStatus>1</nStatus>
        <cDescription/>
        <bCascade/>
      </tblContent>
    </instance>
    <submission id="EditContent" action="" method="post" event="return form_check(this)"/>
    <bind id="cModuleTitle" nodeset="tblContent/cContentName" required="false()" type="string"/>
    <bind nodeset="tblContent/cContentXmlBrief/Content">
      <bind id="cPosition" nodeset="@position" required="true()" type="string"/>
      <bind id="cModuleType" nodeset="@moduleType" required="true()" type="string"/>
      <bind id="cModuleBox" nodeset="@box" required="false()" type="string"/>
      <bind id="cModuleTitle" nodeset="@title" required="false()" type="string"/>
      <bind id="cModuleLink" nodeset="@link" required="false()" type="string"/>
      <bind id="cLinkType" nodeset="@linkType" required="false()" type="string"/>
      <bind id="cModuleLinkText" nodeset="@linkText" required="false()" type="string"/>
      <bind id="nColumns" nodeset="@cols" required="false()" type="string"/>
      <bind id="carousel" nodeset="@carousel" required="false()" type="string"/>
      <bind id="nStepCount" nodeset="@stepCount" required="false()" type="string"/>
      <bind id="cDisplay" nodeset="@display" required="false()" type="string"/>
      <bind id="cSortBy" nodeset="@sortBy" required="false()" type="string"/>
      <bind id="cStepBy" nodeset="@stepBy" required="false()" type="string"/>
      <bind id="cPageOrder" nodeset="@order" required="false()" type="string"/>
      <bind id="cContentRSSFeed" nodeset="@rss" required="false()" type="string"/>
      <bind id="grabberRoot" nodeset="@grabberRoot" required="false()" type="string"/>
      <bind id="grabberItems" nodeset="@grabberItems" required="false()" type="string"/>
      <bind id="grabberItterate" nodeset="@grabberItterate" required="false()" type="string"/>
      <bind id="autoPlaySpeed" nodeset="@autoPlaySpeed" required="false()" type="string"/>
      <bind id="autoplay" nodeset="@autoplay" required="false()" type="string"/>
    </bind>
    <bind id="cContentBody" nodeset="tblContent/cContentXmlBrief/Content" required="false()" type="string"/>
    <ewInclude filePath="/ewcommon/xforms/content/module/genericModule.xml" xPath="descendant-or-self::bind[@nodeset='tblContent/cContentXmlBrief/Content']"/>
    <ewInclude filePath="/ewcommon/xforms/content/module/genericModule.xml" xPath="descendant-or-self::bind[@nodeset='tblContent']"/>
  </model>
  <group ref="EditContent" class="2col">
    <label>Event List Module</label>
    <group>
      <group>
        <!-- These hidden fields and bindings are required for the component-->
        <input bind="nContentKey" class="hidden">
          <label>ContentId</label>
        </input>
        <input bind="cModuleType" class="hidden">
          <label>ModuleType</label>
        </input>
        <!-- end of hidden fields -->
        <ewInclude filePath="/ewcommon/xforms/content/module/genericModule.xml" xPath="descendant-or-self::group[@id='presentation']"/>
        <ewInclude filePath="/ewcommon/xforms/content/module/genericModule.xml" xPath="descendant-or-self::group[@id='publish']"/>
      </group>
    </group>
    <group>
      <group>
        <label>Content</label>
        <input bind="cModuleTitle" class="long">
          <label>Title or Name</label>
        </input>
        <select1 bind="cDisplay" appearance="full">
          <label>Show items</label>
          <item>
            <label>All items on the current page</label>
            <value>all</value>
            <toggle case="cDisplay_1" event="DOMActivate"/>
          </item>
          <item>
            <label>Related items specified below</label>
            <value>related</value>
            <toggle case="cDisplay_2" event="DOMActivate"/>
          </item>
          <item>
            <label>Related to specified tags</label>
            <value>relatedTag</value>
            <toggle case="cDisplay_3" event="DOMActivate"/>
          </item>
          <item>
            <label>Auto Select</label>
            <value>grabber</value>
            <toggle case="cDisplay_4" event="DOMActivate"/>
          </item>
        </select1>
        <switch class="disable">
          <case id="cDisplay_1"/>
          <case id="cDisplay_2">
            <relatedContent search="find add" type="Event" relationType="" direction="1way">
              <label>Events</label>
            </relatedContent>
          </case>
          <case id="cDisplay_3">
            <relatedContent search="find add" type="Tag" relationType="" direction="1way">
              <label>Tag</label>
            </relatedContent>
            <input bind="nMaxDisplay" class="">
              <label>Max Items to display</label>
            </input>
          </case>
          <case id="cDisplay_4">
            <select1 bind="grabberRoot" class="siteTree">
              <label>Source</label>
            </select1>
            <input bind="grabberItems" class="textbox">
              <label>No. of Items to grab</label>
            </input>
            <select bind="grabberItterate" appearance="full">
              <label>Include Child Pages from Source</label>
              <choices/>
              <item>
                <label/>
                <value>true</value>
              </item>
            </select>
           
          </case>
        </switch>
      </group>
      <group class="inline">
        <label>Display Settings</label>
        <select1 bind="nColumns" appearance="full" class="form-group">
          <label>Number of columns</label>
          <item>
            <label>1</label>
            <value>1</value>
          </item>
          <item>
            <label>2</label>
            <value>2</value>
          </item>
          <item>
            <label>3</label>
            <value>3</value>
          </item>
          <item>
            <label>4</label>
            <value>4</value>
          </item>
        </select1>
        <select1 bind="nStepCount" appearance="full" class="form-group">
          <label>Events per page</label>
          <item>
            <label>All</label>
            <value>0</value>
            <toggle case="cStepCounter_1" event="DOMActivate"/>
          </item>
          <item>
            <label>3</label>
            <value>3</value>
            <toggle case="cStepCounter_2" event="DOMActivate"/>
          </item>
          <item>
            <label>5</label>
            <value>5</value>
            <toggle case="cStepCounter_3" event="DOMActivate"/>
          </item>
          <item>
            <label>10</label>
            <value>10</value>
            <toggle case="cStepCounter_4" event="DOMActivate"/>
          </item>
          <item>
            <label>25</label>
            <value>25</value>
            <toggle case="cStepCounter_5" event="DOMActivate"/>
          </item>
          <item bindTo="cStepBy">
            <input bind="cStepBy" class="hidden" />
            <label>Other</label>
            <value>Other</value>
            <toggle case="cStepCounter_6" event="DOMActivate" />
          </item>
        </select1>
        <switch class="disable">
          <case id="cStepCounter_1"/>
          <case id="cStepCounter_2"/>
          <case id="cStepCounter_3"/>
          <case id="cStepCounter_4"/>
          <case id="cStepCounter_5"/>
          <case id="cStepCounter_6">
            <input bind="nStepCount" class="vshort">
              <label>Other stepper value</label>
            </input>
          </case>
        </switch>
        <select1 bind="cSortBy" appearance="full" class="form-group">
          <label>Sort by</label>
          <item>
            <label>Alphabetical</label>
            <value>Headline</value>
            <toggle case="cSortBy_3" event="DOMActivate"/>
          </item>
          <item>
            <label>Start date</label>
            <!-- This can be @attribute or Node() name() to sort by -->
            <value>StartDate</value>
            <toggle case="cSortBy_1" event="DOMActivate"/>
          </item>
          <item>
            <label>End date</label>
            <value>EndDate</value>
            <toggle case="cSortBy_2" event="DOMActivate"/>
          </item>
          <item>
            <label>Published order</label>
            <value>publish</value>
            <toggle case="cSortBy_4" event="DOMActivate"/>
          </item>
          <item>
            <label>Page position</label>
            <value>Position</value>
            <toggle case="cSortBy_5" event="DOMActivate"/>
          </item>
        </select1>
        <switch class="disable">
          <case id="cSortBy_1">
            <select1 bind="cPageOrder" appearance="minimal" class="form-group">
              <label>Order</label>
              <item>
                <label>Present to Future</label>
                <value>ascending</value>
              </item>
              <item>
                <label>Future to Present</label>
                <value>descending</value>
              </item>
            </select1>
          </case>
          <case id="cSortBy_2">
            <select1 bind="cPageOrder" appearance="minimal" class="form-group">
              <label>Order</label>
              <item>
                <label>Present to Future</label>
                <value>ascending</value>
              </item>
              <item>
                <label>Future to Present</label>
                <value>descending</value>
              </item>
            </select1>
          </case>
          <case id="cSortBy_3">
            <select1 bind="cPageOrder" appearance="minimal" class="form-group">
              <label>Order</label>
              <item>
                <label>A to Z</label>
                <value>ascending</value>
              </item>
              <item>
                <label>Z to A</label>
                <value>descending</value>
              </item>
            </select1>
          </case>
          <case id="cSortBy_4">
            <select1 bind="cPageOrder" appearance="minimal" class="form-group">
              <label>Order</label>
              <item>
                <label>Newest to Oldest</label>
                <value>descending</value>
              </item>
              <item>
                <label>Oldest to Newest</label>
                <value>ascending</value>
              </item>
            </select1>
          </case>
          <case id="cSortBy_5"/>
        </switch>
      </group>
      <group class="inline">
        <select1 bind="carousel" appearance="full"  class="form-group">
          <label>Add articles to a carousel</label>
          <item>
            <label>Yes</label>
            <value>true</value>
            <toggle case="Carousel_true" event="DOMActivate"/>
          </item>
          <item>
            <label>No</label>
            <value>false</value>
            <toggle case="Carousel_false" event="DOMActivate"/>
          </item>
          <help class="inline">If selected this option will display articles in a single horizontal line with arrows to scroll through to the left and right.</help>
        </select1>
        <switch class="disable">

          <case id="Carousel_true" >
            <select1 bind="autoplay"  appearance="full" class="form-group ">
              <label>Auto play</label>
              <item>
                <label>Yes</label>
                <value>true</value>
              </item>
              <item>
                <label>No</label>
                <value>false</value>
              </item>
            </select1>
            <input bind="autoPlaySpeed" class="form-group ">
              <label>autoplay Speed (milliseconds) </label>
            </input>
          </case>
          <case id="Carousel_false"/>
        </switch>
      </group>
      <group>
        <label>Content Syndication</label>
        <select1 bind="cContentRSSFeed" appearance="full">
          <label>RSS feed</label>
          <item>
            <label>None</label>
            <value>false</value>
          </item>
          <item>
            <label>Only content in this module</label>
            <value>this</value>
          </item>
          <item>
            <label>All events</label>
            <value>all</value>
          </item>
          <help class="inline">
            <img width="16" height="16" alt="RSS" src="/ewcommon/images/icons/rss16x16.png" style="float:left;margin:0 5px 0 0"/>
            <p>
              An <b>RSS feed</b> is a way for users or other websites to subscribe to your content, or be alerted to changes and new additions.
            </p>
            <p>Specify what content users can subsribe to here.</p>
          </help>
        </select1>
      </group>
      <group>
        <label>Module Links</label>
        <select1 bind="cLinkType" appearance="full">
          <label>Type of link</label>
          <item>
            <label>Internal (Going to a page on this site)</label>
            <value>internal</value>
            <toggle case="cLinkType_1" event="DOMActivate"/>
          </item>
          <item>
            <label>External (Going to another site)</label>
            <value>external</value>
            <toggle case="cLinkType_2" event="DOMActivate"/>
          </item>
        </select1>
        <switch class="disable">
          <case id="cLinkType_1">
            <select1 bind="cModuleLink" class="siteTree">
              <label>Link to page</label>
            </select1>
          </case>
          <case id="cLinkType_2">
            <input bind="cModuleLink" class="short">
              <label>Link to URL</label>
            </input>
          </case>
        </switch>
        <input bind="cModuleLinkText" class="long">
          <label>Module footer link text</label>
        </input>
      </group>
    </group>
  </group>
  <group ref="submit" class="contentSubmit">
    <submit submission="" ref="ewSubmit" class="principle">
      <label>Save Event List</label>
    </submit>
  </group>
</Content>
